/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/**
 *
 * $Id: MaCIError.cpp,v 1.6 2009-05-13 07:18:16 amaula Exp $
 *
 * \file
 * \brief Implementation for MaCI error type handling.
 * \author Antti Maula <antti.maula@tkk.fi>
 */
#include "MaCIError.hpp"

//*****************************************************************************
namespace MaCI 
{

  std::string GetErrorStr(const EMaCIError ecode)
  {
    std::string error;
    
    switch(ecode) {
    case KMaCIOK:
      error = "OK";
    break;
    case KMaCIError:
      error = "General fatal error";
      break;
    case KMaCITimeout:
      error = "Operation timed out";
      break;
    case KMaCIUnknownClient:
      error = "Unknown/invalid GIMnet source/target specified";
      break;
    case KMaCINoConnection:
      error = "No GIMnet connection available";
      break;
    case KMaCIInvalidFormat:
      error = "Encoding/Decoding failed due to invalid format";
      break;
    case KMaCINotActive:
      error = "Operation failed due to inactive backend";
      break;
    case KMaCIAccessDenied:
      error = "Access Denied";
      break;
    case KMaCIInvalidParam:
      error = "Invalid parameters";
      break;
    case KMaCIUnimplemented:
      error = "Requested feature is not implemented";
      break;
    case KMaCIUnknownError:
    default:
      error = "Unknown error";
      break;
    }
    
    return error;
  }
}
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
